package com.wdhcr.osspolicy.controller;

import com.wdhcr.osspolicy.bean.User;
import com.wdhcr.osspolicy.bean.UserJson;
import com.wdhcr.osspolicy.mode.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;

@RestController
public class GetOssUrlBodyDemoController {




    @GetMapping("/user")
    public R getUser() {
        User user = new User();
                user.setId(1L);
                user.setName("狂徒张三");
                user.setImageUrl1("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
                user.setImageUrl2("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
                user.setImageUrl3("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
                user.setImageUrl4("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
                user.setImageUrl5("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
                user.setImageUrl6("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
                user.setImageUrl7("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
                user.setImageUrl8("03cbbb88-15b1-4317-aea2-e0dcefd0d746.jpg");


        User.Stu stu = new User.Stu();
        stu.setSs("0991504f-4fd8-4a85-ad00-19cdbbb9c328.jpg");
        User.Tea tea = new User.Tea();
        tea.setTt("0991504f-4fd8-4a85-ad00-19cdbbb9c328.jpg");
        user.setTea(tea);

        user.setStu(stu);

        ArrayList<User.Aa> aas = new ArrayList<>();
        User.Aa aa = new User.Aa();
        aa.setAa("0991504f-4fd8-4a85-ad00-19cdbbb9c328.jpg");
        aa.setAaa("0991504f-4fd8-4a85-ad00-19cdbbb9c328.jpg");
        aas.add(aa);
        aas.add(aa);
        aas.add(aa);
        user.setAaList(aas);
        User.Cc cc = new User.Cc();
        cc.setCc("0991504f-4fd8-4a85-ad00-19cdbbb9c328.jpg");

        HashMap<String, User.Cc> stringAaHashMap = new HashMap<>();
        stringAaHashMap.put("cc",cc);
        stringAaHashMap.put("cc1",cc);
        stringAaHashMap.put("cc2",cc);
        user.setCcMap(stringAaHashMap);
        User.Dd dd = new User.Dd();
        dd.setDd("0991504f-4fd8-4a85-ad00-19cdbbb9c328.jpg");
        User.Dd[] dds = {dd, dd};
        user.setDds(dds);
        return R.success(user);
    }

    @GetMapping("/getUserJson")
    public R getUserJson() {
        UserJson user = new UserJson();
        user.setId(1L);
        user.setName("狂徒张三");
        user.setImageUrl1("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
        user.setImageUrl2("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
        user.setImageUrl3("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
        user.setImageUrl4("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
        user.setImageUrl5("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
        user.setImageUrl6("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
        user.setImageUrl7("00e09263-c3c9-4edf-b996-1b001dc1c36f.png");
        user.setImageUrl8("03cbbb88-15b1-4317-aea2-e0dcefd0d746.jpg");


        UserJson.Stu stu = new UserJson.Stu();
        stu.setSs("0991504f-4fd8-4a85-ad00-19cdbbb9c328.jpg");
        UserJson.Tea tea = new UserJson.Tea();
        tea.setTt("0991504f-4fd8-4a85-ad00-19cdbbb9c328.jpg");
        user.setTea(tea);

        user.setStu(stu);

        ArrayList<UserJson.Aa> aas = new ArrayList<>();
        UserJson.Aa aa = new UserJson.Aa();
        aa.setAa("0991504f-4fd8-4a85-ad00-19cdbbb9c328.jpg");
        aa.setAaa("0991504f-4fd8-4a85-ad00-19cdbbb9c328.jpg");
        aas.add(aa);
        aas.add(aa);
        aas.add(aa);
        user.setAaList(aas);
        UserJson.Cc cc = new UserJson.Cc();
        cc.setCc("0991504f-4fd8-4a85-ad00-19cdbbb9c328.jpg");

        HashMap<String, UserJson.Cc> stringAaHashMap = new HashMap<>();
        stringAaHashMap.put("cc",cc);
        stringAaHashMap.put("cc1",cc);
        stringAaHashMap.put("cc2",cc);
        user.setCcMap(stringAaHashMap);
        UserJson.Dd dd = new UserJson.Dd();
        dd.setDd("0991504f-4fd8-4a85-ad00-19cdbbb9c328.jpg");
        UserJson.Dd[] dds = {dd, dd};
        user.setDds(dds);
        return R.success(user);
    }


}
